package com.woniu.postbar.controller;

import com.woniu.common.entity.Result;
import com.woniu.postbar.pojo.PostComplaint;
import com.woniu.postbar.service.IPostComplaintService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author wu
 * @since 2023-05-20
 */
@RestController
@RequestMapping("/postComplaint")
@Api(tags = "投诉建议")
public class PostComplaintController {

    @Autowired
    private IPostComplaintService postComplaintService;

    @PostMapping("/addPostComplaint")
    @ApiOperation("添加投诉建议")
    public Result addPostComplaint(@RequestBody PostComplaint postComplaint){
        List<PostComplaint> postComplaints = postComplaintService.addPostComplaint(postComplaint);
        return Result.ok(postComplaints);
    }
}
